//
//  ViewController.m
//  03图文混排
//
//  Created by SteveLi on 2017/10/30.
//  Copyright © 2017年 李军桦. All rights reserved.
//

#import "ViewController.h"

@interface ViewController ()
@property (weak, nonatomic) IBOutlet UILabel *label;

@end

@implementation ViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    //
    NSTextAttachment * attachment = [[NSTextAttachment alloc]init];
    attachment.image = [UIImage imageNamed:@"d_aini"];
    NSAttributedString * attrStr = [NSAttributedString attributedStringWithAttachment:attachment];
    NSMutableAttributedString * strM = [[NSMutableAttributedString alloc]initWithString:@"我"];
    [strM appendAttributedString:attrStr];

    self.label.attributedText = strM;
}


- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}


@end
